package com.exchange.controller.app.work;

import java.util.List;
import com.exchange.controller.BaseController;
import com.exchange.interceptor.AppUserTokenInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;
import com.jfinal.upload.UploadFile;

/**
 * 工单控制器
 **/
@Before({WorkOrderValidator.class,AppUserTokenInterceptor.class})
public class WorkOrderController extends BaseController {

	@Inject
	WorkOrderService service;
	
    /**
     * 我的工单
     */
    public void query(Integer pageNumber){
    	Ret ret = service.query(getAttr("user"), pageNumber);
    	renderJson(ret);
    }

    /**
     * 提交工单
     */
    public void modify(List<UploadFile> materials, String question, String reason){
    	Ret ret = service.modify(getAttr("user"), materials, question, reason);
    	renderJson(ret);
    }
    
    /**
     * 回复
     */
    public void reply(Integer workId, String content){
    	Ret ret = service.reply(getAttr("user"), workId, content);
    	renderJson(ret);
    }
    
    
    
}
